﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Threading.Tasks;
using SignalRService.Interfaces;
using Cache;
using Cache.Model;

namespace SignalRService.Model
{
    public class OPRedisStorage : IOPStorage
    {
        public override T Read<T>(string key)
        {
            return CacheManager.instance.objectFromCache<T>(key);
        }
        public override bool Write<T>(T obj, string key)
        {
            CachingResult<T> result = CacheManager.instance.doCacheObject<T>(obj, key);
            return result.isSuccessCached;
        }
    }
}